本文整理汇总了C++中Label::adjustSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::adjustSize方法的具体用法?C++ Label::adjustSize怎么用?C++ Label::adjustSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label::adjustSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dropEvent
void MainWindow::dropEvent(QDropEvent *event)
{
if (event->mimeData()->hasFormat("application/x-dnditemdata")) {
QByteArray itemData = event->mimeData()->data("application/x-dnditemdata");
QDataStream dataStream(&itemData, QIODevice::ReadOnly);
QPixmap pixmap;
QPoint offset;
dataStream >> pixmap >> offset;
Label *newIcon = new Label(this);
newIcon->setPixmap(pixmap);
newIcon->move(event->pos() - offset);
newIcon->adjustSize();
newIcon->setAttribute(Qt::WA_DeleteOnClose);
bool tirar = false;
int rmov;
int rult;
QString rango1;
QString rango2;
newIcon->nodo=moviendo->nodo;
int x1=uno->cont;
int x2=dos->cont;
int x3=tres->cont;
int x4=cuatro->cont;
int x5=cinco->cont;
int x6=seis->cont;
int x7=siete->cont;
if(newIcon->pos().rx()>15 && newIcon->pos().rx() <25 && uno->cont >= 1)
{
Nodo *ultimo = uno->recuperar(x1-1);
if(ultimo==NULL)
return;
rmov=moviendo->nodo->carta->getRango().toInt();
newIcon->pertenece=uno;
rango1 = ultimo->carta->getRango();
rango2 = moviendo->nodo->carta->getRango();
if(rango1=="J")
rmov=11;
if(rango1=="Q")
rmov=12;
if(rango1=="K")
rmov=13;
rult=ultimo->carta->getRango().toInt();
if(rango2=="J")
rult=11;
if(rango2=="Q")
rult=12;
if(rango2=="K")
rult=13;
if(ultimo->carta->getColor() != moviendo->nodo->carta->getColor()
&& rmov == rult-1 || (rmov==13) && (rult==0))
{
tirar=true;
}
}
if(newIcon->pos().rx()>125 && newIcon->pos().rx() <135 && dos->cont >= 1)
{
Nodo *ultimo = dos->recuperar(x2-1);
if(ultimo==NULL)
return;
rmov=moviendo->nodo->carta->getRango().toInt();
newIcon->pertenece=dos;
rango1 = ultimo->carta->getRango();
rango2 = moviendo->nodo->carta->getRango();
if(rango1=="J")
rmov=11;
if(rango1=="Q")
rmov=12;
if(rango1=="K")
rmov=13;
rult=ultimo->carta->getRango().toInt();
if(rango2=="J")
rult=11;
if(rango2=="Q")
rult=12;
if(rango2=="K")
rult=13;
if(ultimo->carta->getColor() != moviendo->nodo->carta->getColor()
//.........这里部分代码省略.........