在安装支持XCB的Qt5期间 ./configure -prefix $ PWD/qtbase -opensource -nomake tests -qpa xcb -qt-xcb失败,因为它无法链接到libXau和libXdmcp
/usr/local/lib/libxcb.a(xcb_auth.o): In function `get_authptr':
/users/salunkrj/libxcb-1.9/src/xcb_auth.c:163: undefined reference to `XauGetBestAuthByAddr'
/usr/local/lib/libxcb.a(xcb_auth.o): In function `_xcb_get_auth_info':
/users/salunkrj/libxcb-1.9/src/xcb_auth.c:377: undefined reference to `XauDisposeAuth'
/usr/local/lib/libxcb.a(xcb_auth.o): In function `compute_auth':
/users/salunkrj/libxcb-1.9/src/xcb_auth.c:256: undefined reference to `XdmcpWrap'
/usr/local/lib/libxcb.a(xcb_auth.o): In function `_xcb_get_auth_info':
/users/salunkrj/libxcb-1.9/src/xcb_auth.c:369: undefined reference to `XauDisposeAuth'
collect2: ld returned 1 exit status
gmake: *** [xcb] Error 1
xcb disabled.
The test for linking against libxcb failed!
You might need to install dependency packages for libxcb.
Run Code Online (Sandbox Code Playgroud)
libXau:XauDisposeAuth和XauGetBestAuthByAddr的符号名称确实存在并在我执行查找时显示,LD_LIBRARY_PATH包含 …
我正在尝试从QTableView小部件(下面复制的代码段)返回所选行的向量,但返回的值与选择不对应,我相信我不了解QTableView的QModelIndexList/QModelIndex.你能让我知道我错在哪里或从QTableView访问所选项目的正确方法吗?C_model的类型为QStandardItemModel
for(int i = 0; i < c_model->rowCount(); i++)
{
if (selectionModel->isRowSelected(i, QModelIndex()))
{
QStringList selection;
std::vector<std::string> currentIndexValues;
for (int j = 0; j < c_model->columnCount(); j++)
{
QVariant q = c_model->data(c_model->index(i, j));
selection.append(q.toString());
currentIndexValues.push_back(q.toString().toLocal8Bit().constData());
printf(" %s\t ", currentIndexValues[j].c_str());
}
printf("\n");
v_selectedItems.push_back(currentIndexValues);
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我在 some_1.xyz 中有一个具有以下语法的文件
module some_1 {
INPUT PINS
OUTPUT PINS
}
Run Code Online (Sandbox Code Playgroud)
我想在 line module some_1 { 之后插入 APPLY DELAYS xx 和 APPLY LOADS ld
以下代码仅适用于一个文件,即,如果我将 some_1.xyz 替换为 *.xyz,则该脚本不起作用。我尝试引入 sleep(xx) 但代码对多个文件不起作用,我无法弄清楚为什么它不起作用。任何指针表示赞赏。谢谢
@modulename_array = `grep "module " some_1.xyz | cut -f 2 -d ' '`;
@line = `grep "module " some_1.xyz`;
chomp(@line);
chomp(@kfarray);
$i = 0;
foreach (@modulename_array) {
print "Applying delay and load to $_.xyz $line[$i] \n";
`perl -ni -le 'print; print "\tAPPLY DELAY xx \n \tAPPLY LOADS ld\n" if/$line[$i]/' $_.xyz`; …Run Code Online (Sandbox Code Playgroud) 我在理解为什么源命令行的csh命令在命令行中正常工作但在合并到Perl脚本时无法工作时遇到了一些麻烦.
my @envvar = ();
if (-e $ENV{WSDIR}."/<script>.csh") {
@envvar = `csh -c "cd $WSDIR ; source <script>.csh ; env"`;
}
Run Code Online (Sandbox Code Playgroud)
运行时我在Perl脚本中收到如下错误:script.csh:没有这样的文件或目录,而从终端作为csh命令运行按预期工作.在Perl中的csh命令中使用环境变量有什么限制?我该如何克服这个问题.
我正在尝试将一个QgraphicsView(QColorDialog)小部件添加到Palette对话框中,但是QGraphicsScene与该小部件相对应的QColorDialog始终是空白,如果读者能够帮助我纠正我的错误,那将会有很大的帮助。
Qt-4.8.4-Linux(CentOS)
GraphicsView将包含在的小部件PalletteDialog
ClrWidget::ClrWidget(QWidget *parent) :
QGraphicsView(parent)
{
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setFrameStyle(QFrame::NoFrame);
setScene(new QGraphicsScene(this));
_dialog = new QColorDialog();
_dialog->setOption(QColorDialog::NoButtons, true);
setMinimumSize(_dialog->size());
setMaximumSize(_dialog->size());
QGraphicsProxyWidget *proxyWidget = new QGraphicsProxyWidget();
proxyWidget->setWidget(_dialog);
//scene()->addItem(proxyWidget);
//scene()->setSceneRect(proxyWidget->geometry());
scene()->addWidget(_dialog);
scene()->setSceneRect(_dialog->geometry());
}
Run Code Online (Sandbox Code Playgroud)PaletteDialog构造函数
PaletteDialog::PaletteDialog(QWidget *parent)
: QDialog(parent),
ui(new Ui::PaletteDialog),
{
//PaletteDialog sets up the ClrWidget
ui->setupUi(this);
...
}
Run Code Online (Sandbox Code Playgroud)下面列出的代码是为了帮助我在C#中找到二维数组的行和列大小,但在访问列长度时(GetLength(1)),我最终会得到一个IndexOutOfRangeException.我的查找类似于q-a,但无法确定列大小.
List<List<int>> intLists = new List<List<int>>();
for (int i = 0; i < 2; i++)
{
List<int> tempList = new List<int>();
for (int j = 0; j < 5; j++)
tempList.Add(j + 5+i);
intLists.Add(tempList);
}
int[][] intArray = intLists.Select(Enumerable.ToArray).ToArray();
Console.WriteLine("Dimension 0 Length = " + intArray[0].Length);
Console.WriteLine("Dimension 1 Length = " + intArray[1].Length);
Console.WriteLine("Dimension 0 Length = " + intArray.GetLength(0));
//Console.WriteLine("Dimension 1 Length = " + intArray.GetLength(1));
Run Code Online (Sandbox Code Playgroud)